from django.db import models


class Property(models.Model):
    name = models.CharField(max_length=255, blank=True, null=True)
    rank = models.SmallIntegerField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'property'


class Residential(models.Model):
    name = models.CharField(max_length=255)
    complete_date = models.CharField(max_length=255, blank=True, null=True)
    park_num = models.IntegerField(blank=True, null=True)
    property_name = models.CharField(max_length=255, blank=True, null=True)
    property_fee = models.FloatField(blank=True, null=True)
    developers = models.CharField(max_length=255, blank=True, null=True)
    households = models.IntegerField(blank=True, null=True)
    desc = models.TextField(blank=True, null=True)
    avg_price = models.CharField(max_length=255, blank=True, null=True)
    url = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'residential'


class School(models.Model):
    name = models.CharField(max_length=255)
    rank = models.IntegerField(blank=True, null=True)
    address = models.CharField(max_length=255, blank=True, null=True)
    nature = models.CharField(max_length=255, blank=True, null=True)
    residential_num = models.IntegerField(blank=True, null=True)
    stage = models.CharField(max_length=255, blank=True, null=True)
    region = models.CharField(max_length=255, blank=True, null=True)
    url = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'school'


class SchoolResidentialRel(models.Model):
    school_name = models.CharField(max_length=255, blank=True, null=True)
    residential_name = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'school_residential_rel'